<!--#INCLUDE FILE="programmer.inc"-->
<!--#INCLUDE FILE="conn.asp"-->
<!-- #include file="comSub.asp" -->
<!-- #include file="function.asp" -->
<!-- #include file="function_charCode.asp" -->
<script src=inc/js1.js></script>
<script src=inc/js2.js></script>
<!-- #include file="UBB/myUBB.asp" -->

<%
call stylefile()

dim boardid,Page
boardid = Request.QueryString("boardid")
Page = Request.QueryString("Page")
if LoginYesNo() = true then      
       if session("tslt_username")="" then
              ' Response.redirect ("erroruserlogin.asp?info=ȵ¼ٷ")
              Response.redirect ("error.asp?userlogin=ok&boardurl="&Request.QueryString("boardid")&"&Page="&Request.QueryString("Page")&"&info=ȵ¼ٷ")
              Response.End
       end if
end if
%>

<Script Language=JavaScript>
   function doSubmit(){
	if (document.form1.Subject.value==""){
		alert("ⲻΪգ");
                                   document.form1.Subject.focus();
		return false;
                  }
	if (document.form1.textarea2){    // ʹöı֤
	      if (document.form1.textarea2.value==""){
		alert("ݲΪգ");
                                   document.form1.textarea2.focus();
		return false;
	       }
                  }else{                                
	      if (eWebEditor1.getHTML()==""){    // getHTML()ΪeWebEditorԴĽӿںΪȡ༭
		alert("ݲΪգ");
		return false;
	      }
	 }
	document.form1.submit();
	}
</Script>
	
<HTML>
<HEAD>
<TITLE></TITLE>
</HEAD>
<BODY topmargin=0 background=images/bg2.gif Bgproperties="fixed" >
<table border=0 width=100% cellspacing=0 cellpadding=1>
         <tr>
                  <td width=100 height="67" bgcolor=greenyellow>
                          <img border="0" src="images/tushan2.gif" width="100" height="65" align=middle vspace=0 hspace=0>
                  </td>
                  <td rowspan=2 bgcolor=dodgerblue>
                          <a href=advertisement/fblyad/top.htm target="new">
                           <%
                                 set objad=server.createobject("mswc.adrotator")
                                 response.write objad.getadvertisement("advertisement/fblyad/topadrot.txt")
                                 set objad=nothing
                            %>
                           </a>
                  </td>
         </tr>
         <tr>
                  <td height="6" bgcolor=dodgerblue>
                  </td>
         </tr>
</table>
<table border=0 width=20% align=left cellspacing="1" cellpadding="1">
       <tr height=60>
             <td bgcolor=dodgerblue>
                    <a href=advertisement/fblyad/left1.htm target="new">
                    <%
                          set objad=server.createobject("mswc.adrotator")
                          response.write objad.getadvertisement("advertisement/fblyad/leftadrot1.txt")
                          set objad=nothing
                     %>
                     </a>
              </td>
       </tr>
       <tr height=10>
                <td>
       </tr>
       <tr height=60>
                <td bgcolor=dodgerblue>
                       <a href=advertisement/fblyad/left2.htm target="new">
                       <%
                             set objad=server.createobject("mswc.adrotator")
                             response.write objad.getadvertisement("advertisement/fblyad/leftadrot2.txt")
                             set objad=nothing
                       %>
                       </a>
               </td>
       </tr>
       <tr height=10>
                <td>
       </tr>
       <tr height=60>
              <td bgcolor=dodgerblue>
                     <a href=advertisement/fblyad/left3.htm target="new">
                     <%
                           set objad=server.createobject("mswc.adrotator")
                           response.write objad.getadvertisement("advertisement/fblyad/leftadrot3.txt")
                           set objad=nothing
                      %>
                      </a>
             </td>
      </tr>
      <tr height=10>
              <td>
      </tr>
      <tr height=60>
              <td bgcolor=dodgerblue>
                     <a href=advertisement/fblyad/left4.htm target="new">
                     <%
                           set objad=server.createobject("mswc.adrotator")
                           response.write objad.getadvertisement("advertisement/fblyad/leftadrot4.txt")
                           set objad=nothing
                      %>
                      </a>
               </td>
       </tr>
 </table>

<center>
<table class=td8 border=0 width=78% cellspacing="0" cellpadding="6">
       <tr>
               <td align=left class=font3 onmouseout="HideDivMenu2(2)">
                       <img src=images/home.gif><a class=a4 onmouseover="Cmenu1.style.display='block'" href=index.asp >̳ҳ</a>
                       <DIV id="Cmenu1" onmouseover="Cmenu1.style.display='block'" onmouseout="Cmenu1.style.display='none'" style="display:none; position:absolute; z-index:10">
                                 <%call CNavigation_BM()%>
                       </DIV>
                       <b></b>&nbsp;<a class=a4 onmouseover="Bmenu1.style.display='block'" href=community.asp?communityid=<%=Communityid_B_boardid(request("boardid"))%>><%=Communityname(Communityid_B_boardid(request("boardid")))%></a>
                       <DIV id="Bmenu1" onmouseover="Bmenu1.style.display='block'" onmouseout="Bmenu1.style.display='none'" style="display:none; position:absolute;">
                                 <%call BNavigation_BM(Communityid_B_boardid(request("boardid")))%>
                       </DIV>
                       <b></b>&nbsp;<a class=a4 href=board.asp?boardid=<%=Request("boardid")%>><%=boardname(Request("boardid"))%></a>
                       <b></b>&nbsp;
              </td>
              <td align=right class=font3>
                       <%if (session("tslt_useridentity")=1 or session("tslt_useridentity")=2) then%>
                               <A class=a4 href="admin_index/ad_index.asp"></A>
                       <%end if%>
                       <%if session("tslt_username")<>"" then%>
                               <%if session("tslt_openFrameChat")=True then%>
                                          <A class=a2 href="javascript:parent.bottomFrame.location.href='chat/exit.asp';parent.location.href='logout.asp';"><font color=red>ע¼</font></A>
                               <%else%>
                                          <A class=a2 href="logout.asp"><font color=red>ע¼</font></A>
                               <%end if%>
                       <%else%>
                               <%if session("tslt_username")="" then%>
                                       <A class=a4 href="userlogin.asp">¼</A>&nbsp;<A class=a4 href="zc.asp">ע</A>
                               <%end if%>
                       <%end if%>
                       <A class=a4 id="TopRight_mune2" onmouseover="ShowDivMenu(2)">ܲ˵</A>
                       <DIV id="div_mune2" align="right" style="display:none;" onmouseover="ShowDivMenu(2)" onmouseout="HideDivMenu(2)">
                               <table border="0" cellspacing="0" cellpadding="0" bordercolordark='#000000' bordercolorlight='#000000'>
                                    <tr>
                                          <td height="4">
                                          </td >
                                     <tr>
                                          <td class=font3>
			    <img src="images/wyl.gif" width="17" height="17" border=0 align=absmiddle><A class=a4 target="_blank" href="wyl/wy.asp">¼</A>
			    <%If session("tslt_openFrameChat")="" then%>
			          <img src="images/lts.gif" width="17" height="17" border=0 align=absmiddle><A class=a4 href="index_Frame.asp?currentPU=<%=currentPageUrl%>"></A>
                                                <%else%>
			          <img src="images/lts.gif" width="17" height="17" border=0 align=absmiddle><A class=a4 href="javascript:parent.bottomFrame.location.href='chat/exit.asp';parent.location.href=self.location.href;">ر</A>
                                                <%End if%>
	                           </td>
                                     </tr>
                               </table>
                         </DIV>
                </td>
       </tr>
       <tr height=7 bgcolor=#ffffff>
               <td colspan=2></td>
       </tr>
</table>

<br>
<TABLE border=0 width=78% bgcolor=#e8f0ff>
        <form action="fbly.asp" method="post" name="form1">
        <input type=hidden name="isok" value="ok">
        <input type=hidden name=d_savepathfilename>
        <input type=hidden name=boardid value="<%=boardid%>">
        <input type=hidden name=Page value="<%=Request("Page")%>">
        <input type=hidden name=MyCommunityid value="<%=Communityid_B_boardid(boardid)%>">
         <%if session("tslt_username")<>"" then%>
                  <TR><TD height=35 align=center><font color=red>*</font>&nbsp;û</TD>
                            <TD><INPUT maxlength=20 name=Username size=14 value=<%=session("tslt_username")%> ReadOnly=false></TD>
                            <TD height=35 align=center><font color=red>*</font>&nbsp;
                            <INPUT type="password" maxlength=16 size=14 name=password value=<%=session("tslt_password")%> ReadOnly=false></TD></TR>
                  </TR>
         <%end if%>
         <TR><TD height=35 align=center><font color=red>*</font>&nbsp;&nbsp;&nbsp;</TD>
                   <TD colspan=2><INPUT maxlength=30 name=Subject value="" size=41></TD></TR>
          </TR>
          <%if (session("tslt_useridentity")=1 or session("tslt_useridentity")=2) then%>
                    <TR><TD height=35 align=center>
                                      <font color=red>*</font>&nbsp;&nbsp;&nbsp;
                              </TD>
                              <TD colspan=2><TEXTAREA cols=40 ID=textarea1 name=Content  style="display:none" rows=6></TEXTAREA>
                                      <iframe ID="eWebEditor1" src="ewebeditor/ewebeditor.htm?id=content&style=coolblue&savepathfilename=d_savepathfilename" frameborder="0" scrolling="no" width="600" HEIGHT="300"></iframe>
                              </TD>
                    </TR>
          <%else%> 
                    <%if IsEWebYesNo() then%>
                              <TR><TD height=35 align=center>
                                                <font color=red>*</font>&nbsp;&nbsp;&nbsp;
                                        </TD>
                                        <TD colspan=2><TEXTAREA cols=40 ID=textarea1 name=Content  style="display:none" rows=6></TEXTAREA>
                                                <iframe ID="eWebEditor1" src="ewebeditor/ewebeditor.htm?id=content&style=coolblue&savepathfilename=d_savepathfilename" frameborder="0" scrolling="no" width="600" HEIGHT="300"></iframe>
                                        </TD>
                               </TR>
                    <%else%>
                               <TR><TD height=35 align=center>
                                                 <font color=red>*</font>&nbsp;&nbsp;&nbsp;
		              <br><span style="font-size:12px"><a class=a1 href="UBB/UBBHtml.htm" target="_blank">֧UBB룩</span>
                                         </TD>
                                         <TD colspan=2>
                                                 <TEXTAREA ID=textarea2 name=Content cols=40 rows=6></TEXTAREA></TD>
                                         </TD>
                                </TR>
                     <%end if%>
          <%end if%>
          <TR><TD colspan=3>
<%
               If VCYes() Then
                   Response.Write "<font color='#FF0000'>*&nbsp;</font>֤&nbsp;<input type='text' name='chknum' size='8'>&nbsp;&nbsp;"
                   Call ImgVCShow()
               End If
%>
          </TR></TD>
          <%if session("tslt_username")<>"" then%>
                    <TR><TD height=35 align=center><font size=1>Ļ</font></td>
                             <TD colspan=2>
                                    <input name="secret" type="checkbox" id="secret2" value="1">
                                    <font size=2>ѡֻ߱ˡ͹Աſɿ¼ظݣ(<strong>¼</strong>)</font></div>
                             </TD>
                     </TR>
          <%end if%>
          <TR align=middle>
                   <TD height=40 colspan=3 align=center>
                           <input class=input2 type=button name=btnSubmit value="   " onclick="doSubmit()"> 
                           <input class=input2 type=reset name=btnReset value="   ">
                   </TD>
          </TR>
          <TR>
                    <TD colspan=3 align=right>
                           <a  class=a1 href='javascript:history.back()'><font face="_GB2312" color=dodgerred size="4"></font></a>&nbsp;&nbsp;&nbsp;&nbsp;
                   </TD>
          </TR>
          </form>
</TABLE>
</BODY>  
</HTML>

<%
if request.form("isok")="ok"  then
       if session("tslt_username")<>"" then 
              call fbly_add()      
       else
              call YouKeFbly_add()         
       end if
end if

Call conn_Nothing()

function LoginYesNo()
        dim rs,Sql                  
        Sql = "select LoginYes from option1"
        set rs=conn.execute(Sql)
              LoginYesNo=rs("LoginYes")
         rs.close
         set rs=nothing
end function

sub fbly_add()
     if VCYes() then 
            Call ImgVCShow_handle() 
     end if
     Set rs = Server.CreateObject("ADODB.Recordset")
     strSql = "Select * from ts_userinfo where username = '" & Request("Username") &"'"
     set rs = conn.Execute (StrSql)
          if rs("ForbidIP")=true and Request("username")=session("tslt_username") then
                 Response.redirect  ("error.asp?FblyIp=ok&boardurl="&Request("boardid")&"&PageNo="&Request("PageNo")&"&info=IPѱֹ")
          end if
          if request.cookies("soonmess")("lastpost") <> ""  then
                  if DateDiff("s",request.cookies("soonmess")("lastpost"),Now())<MySI() then
                         Response.redirect  ("error.asp?FblyGS=ok&boardurl="&Request("boardid")&"&PageNo="&Request("PageNo")&"&info=̷ʱ̣ʱ" &MySI()& "룬벻Ҫˮ")
                  end if
          end if
          response.cookies("soonmess")("lastpost")=Now()
          userloginip = userIP()
          conn.Execute ("update ts_userinfo set loginIP='" &userloginip&"' where username = '" & Request("Username") &"'")
          Set objRS = Server.CreateObject("ADODB.Recordset")
          objRS.Open "article", Conn, 1, 3
                      Dim User, Content, AddTime,boardid,Communityid
                      Dim subjectfiltrate, strB,strtemp1
                      Dim strSQL,objRS2,arrays
                      Communityid = Request("MyCommunityid") 
                      boardid = Request("boardid")
                      User = Request("Username")
                      subject = request("subject")
                      subject = FiltraterChar(subject)
                      strtemp1=subject
                      Set objRS2 = Server.CreateObject("ADODB.Recordset")
                      objRS2.Open "option1", Conn, 1, 3
                            strB=objRS2("SubjectFiltrate")
                            if strB<>"" then 
                                  arrays=Split(strB,"|")
                                  for ii=0 to ubound(arrays)
                                        if instr(strtemp1,arrays(ii))<>0 then response.Redirect "error.asp?FblyStr=ok&boardurl="&Request("boardid")&"&Page="&Request("Page")&"&info=ڷǷַ "&arrays(ii)&" ܷ"
                                  next
                            end if
                            Subject=strtemp1
                      objRS2.close      
                      Set objRS2 = Nothing
                       AddTime = now()
                       secret=request.Form("secret")
                       if secret<>1 then secret=0
                       sendip = userIP()
                        if (session("tslt_useridentity")=1 or session("tslt_useridentity")=2) then
                               Content = ""
                               For i = 1 To Request.Form("content").Count
                                       Content = Content & Request.Form("content")(i)
                               Next
                       else
                               if IsEWebYesNo()=true then
                                      Content = ""
                                      For i = 1 To Request.Form("content").Count
                                            Content = Content & Request.Form("content")(i)
                                       Next
                               end if
                                if IsEWebYesNo()=false then                      
                                      Content = Request.Form("content")
                                      Content = myReplace(Content) 
                                      Content = UBBCode(Content)
                                end if
                        end if
                        Dim sSavePathFileName
                        sSavePathFileName = GetSafeStr(Request.Form("d_savepathfilename"))
                        dim ContentAllSize
                        ContentAllSize = Len(Content) + FileContentSize(sSavePathFileName)
                        dim ContentAllSize2
                        ContentAllSize2 = FileContentSize2(Len(Content)+ FileContentSize(sSavePathFileName))
                         Dim myAddDate
                         myAddDate=Date()
                         objRS.AddNew Array("Communityid","boardid","User","subject","AddTime","addDate","firstAddTime","lastReplyTime","tempTopDate","Content","Contentsize","Contentsize2","secret","sendip","D_SavePathFileName"), _
                         Array(Communityid,boardid,User,subject,AddTime,myAddDate,AddTime,AddTime,myAddDate,Content,ContentAllSize,ContentAllSize2,secret,sendip,sSavePathFileName) 
                         objRS.Update
          objRS.close
          Set objRS = Nothing
          strSql = "Select * from ts_userinfo where username = '" & Request("Username") &"'"
          set rs = conn.Execute (StrSql)
          dim  UserIntegral2
          UserIntegral2= rs("UserIntegral")+UserScore("MainScore")
          dim  passArticle
          passArticle = rs("articleTotal")
          passArticle = passArticle+1
          conn.Execute ("update ts_userinfo set articleTotal='"&passArticle&"',UserIntegral='"&UserIntegral2&"'  where username = '"&Request("Username")&"'")
          Response.redirect  ("error.asp?Fblyok=ok&boardurl="&Request("boardid")&"&Page="&Request("Page")&"&info=<font color=red size=4>ףأѾɹ!</font>")
		  Call ImgVCRndnum()
    RS.close
    Set RS = Nothing
end sub

sub YouKeFbly_add()
         if VCYes() then
                Call ImgVCShow_handle()
         end if
          if request.cookies("soonmess")("lastpost") <> ""  then
                  if DateDiff("s",request.cookies("soonmess")("lastpost"),Now())<MySI() then
                         Response.redirect  ("error.asp?FblyGS=ok&boardurl="&Request("boardid")&"&Page="&Request("Page")&"&info=̷ʱ̣ʱ" &MySI()& "룬벻Ҫˮ")
                  end if
          end if
          response.cookies("soonmess")("lastpost")=Now()
          Set objRS = Server.CreateObject("ADODB.Recordset")
          objRS.Open "article", Conn, 1, 3
                      Dim User, Content, AddTime,boardid,Communityid
                      Dim subjectfiltrate, strB,strtemp1
                      Dim strSQL,objRS2,arrays
                      Communityid = Request("MyCommunityid")
                      boardid = Request("boardid")
                      subject = request("subject")
                      subject = FiltraterChar(subject)
                      strtemp1=subject
                      Set objRS2 = Server.CreateObject("ADODB.Recordset")
                      objRS2.Open "option1", Conn, 1, 3
                            strB=objRS2("SubjectFiltrate")
                            if strB<>"" then 
                                  arrays=Split(strB,"|")
                                  for ii=0 to ubound(arrays)
                                        if instr(strtemp1,arrays(ii))<>0 then response.Redirect "error.asp?FblyStr=ok&boardurl="&Request("boardid")&"&Page="&Request("Page")&"&info=ڷǷַ "&arrays(ii)&" ܷ"
                                  next
                            end if
                            Subject=strtemp1
                      objRS2.close      
                      Set objRS2 = Nothing
                       AddTime = now()
                       sendip = userIP()
                        if IsEWebYesNo() then       
                              Content = ""
                               For i = 1 To Request.Form("content").Count
                                       Content = Content & Request.Form("content")(i)
                               Next
                        end if
                        if IsEWebYesNo()=false then  
                                Content = Request.Form("content")
                                Content = myReplace(Content)
                                Content = UBBCode(Content)
                        end if
                        Dim sSavePathFileName
                        sSavePathFileName = GetSafeStr(Request.Form("d_savepathfilename"))
                        dim ContentAllSize
                        ContentAllSize = Len(Content) + FileContentSize(sSavePathFileName)
                        dim ContentAllSize2
                        ContentAllSize2 = FileContentSize2(Len(Content)+ FileContentSize(sSavePathFileName))
                         Dim myAddDate
                         myAddDate=Date()
                         objRS.AddNew Array("Communityid","boardid","subject","AddTime","addDate","firstAddTime","lastReplyTime","Content","Contentsize", "Contentsize2","sendip","D_SavePathFileName"), _
                         Array(Communityid,boardid,subject,AddTime,myAddDate,AddTime,AddTime,Content,ContentAllSize,ContentAllSize2,sendip,sSavePathFileName) 
                         objRS.Update
          objRS.close
          Set objRS = Nothing
          Response.redirect  ("error.asp?Fblyok=ok&boardurl="&Request("boardid")&"&Page="&Request("Page")&"&info=<font color=red size=4>ףأѾɹ!</font>")
		  Call ImgVCRndnum()
end sub

function IsEWebYesNo()
        dim rs,Sql                  
        Sql = "select IsEWeb from option1"
        set rs=conn.execute(Sql)
              IsEWebYesNo=rs("IsEWeb")
        rs.close
        set rs=nothing
end function

%>